package com.lefevre.cms.bean.links;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 友情链接
 *
 * @author Lefevre
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("links")
@Entity
public class Links implements Serializable {
    private static final long serialVersionUID = -7640610316706427936L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.INPUT)
    private Integer id;

    /**
     * 名称
     **/
    @Column(length = 190)
    @TableField("`name`")
    private String name;

    /**
     * 网址
     **/
    @TableField("url")
    @Column(length = 250)
    private String url;

    /**
     * 排序
     **/
    @TableField("sort")
    private Integer sort = 0;

    /**
     * 图片
     **/
    @Column(length = 100)
    @TableField("image")
    private String image;

    /**
     * 创建时间
     **/
    @Temporal(TemporalType.TIMESTAMP)
    @TableField("createDate")
    private Date createDate = new Date();

}
